/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package actioncombination.logic.rlmethod;

import actioncombination.common.value.DoubleValue;
import actioncombination.logic.agent.action.Action;
import actioncombination.logic.agent.RLAgent;
import actioncombination.problem.gridworld.AgentStateImpl;
import actioncombination.logic.policy.PolicyStrategy;

/**
 *
 * @author Administrador
 */
public abstract class RLMethodStrategy {
    protected PolicyStrategy polStrategy;
    protected DoubleValue learningStep;
    protected DoubleValue discountRate;

    public RLMethodStrategy(PolicyStrategy polStrategy) {
        this.polStrategy = polStrategy;
        learningStep = new DoubleValue(0.2);
        discountRate = new DoubleValue(0.2);
    }

    public RLMethodStrategy(PolicyStrategy polStrategy, DoubleValue learningStep, DoubleValue discountRate) {
        this.polStrategy = polStrategy;
        this.learningStep = learningStep;
        this.discountRate = discountRate;
    }

    public abstract void beginEpisode(RLAgent agent);

    
    protected abstract void endEpisode();

    protected PolicyStrategy getPolStrategy() {
        return polStrategy;
    }

    protected void setPolStrategy(PolicyStrategy polStrategy) {
        this.polStrategy = polStrategy;
    }

    /**
     * Retorna el coeficiente de aprendizaje alfa
     * @return DoubleValue valor del coeficiente de aprendizaje
     * @see DoubleValue, Value
     */
    public DoubleValue getLearningStep() {
        return learningStep;
    }

    /**
     * 
     * @param learningStep 
     */
    public void setLearningStep(DoubleValue learningStep) {
        this.learningStep = learningStep;
    }
    /**
     * Retorna la tasa de descuento gamma
     * @return DoubleValue valor del coeficiente de aprendizaje
     * @see DoubleValue, Value
     */
    public DoubleValue getDiscountRate() {
        return discountRate;
    }
    /**
     * 
     * @param discountRate
     */
    public void setDiscountRate(DoubleValue discountRate) {
        this.discountRate = discountRate;
    }
}
